<!--查看项目报名者-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>报名者信息</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" th:href="@{/style/basic.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/style/comment.css}"/>
    <link type="text/css" rel="stylesheet" th:href="@{/style/biobox2.css}"/>
    <link th:href="@{/mb/css/bootstrap.min.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/mb/css/css.css}" rel="stylesheet" type="text/css">
    <link th:href="@{/mb/css/Animation.css}" rel="stylesheet" type="text/css">
    <link rel="stylesheet" th:href="@{/layui/dist/css/layui.css}" media="all">
    <link rel="stylesheet" type="text/css" th:href="@{/style/container.css}">


    <style type="text/css">
        .refusebutton {
            background-color: red;
            border: none;
            color: white;
            padding: 4px 12px;
            text-align: center;
            border-radius: 4px;
            font-size: 12px;
            margin: 4px 2px;
            cursor: pointer;
        }

        tr {
            line-height: 30px;
        }
    </style>
</head>
<body>
<!--头部代码开始-->
<!--头开始-->
<header class="navbar-fixed-top headerbg" th:each="codeUser:${codeUsers}">
    <!--左上角logo-->
    <div class="logo">
        <a href="http://www.baidu.com" th:href="@{/mc/logged/loginIndex(userNo=${codeUser.userNo})}" class="fl mt10">
            <img th:src="@{/mb/images/mclogo.png}" style="margin-top: -30px;margin-left: 30px" alt=""></a></div>

    <!--导航栏剩余部分-->
    <div class="navBox hidden-xs hidden-sm" style="float: right;margin-right: 10%">
        <ul class="navList list-unstyled">
            <li class="navLi">
                <h3>
                    <a th:href="@{/mc/logged/loginIndex(userNo=${codeUser.userNo})}"><span>首页</span></a>
                </h3>
            </li>
            <li class="navLi"><h3><a href="#"
                                     th:href="@{/mc/item/loginItemsList(userNo=${codeUser.userNo})}"><span>项目</span></a>
            </h3></li>

            <li class="navLi">
                <h3>
                    <div th:if="${codeUser.type}==1">
                        <a href="#" th:href="@{/mc/item/myRelease(userNo=${codeUser.userNo})}"><span>我的发布</span></a>
                    </div>
                </h3>
            </li>

            <li class="navLi">
                <h3>
                        <span th:if="${codeUser.type}==1">
                            <a href="#"
                               th:href="@{/mc/item/releaseProject(userNo=${codeUser.userNo})}"><span>项目发布</span></a></span>
                </h3>
            </li>
            <li class="navLi">
                <h3>
                        <span th:if="${codeUser.type}==2">
                            <a href="#" th:href="@{/mc/stage/participatingProjects(userNo=${codeUser.userNo})}"><span>我的参与</span></a></span>
                </h3>
            </li>
            <li class="navLi"><h3><a href="#"
                                     th:href="@{/mc/logged/help(userNo=${codeUser.userNo})}"><span>帮助</span></a></h3>
            </li>
            <li class="navLi"><h3>
                <span th:if="${codeUser.image}">
                <img th:src="@{'/article/'+ ${codeUser.image}}" height="60px" width="60px"> </span>
                <span th:unless="${codeUser.image}">
                <img th:src="@{/images/center.png}" height="60px" width="60px">
                </span></h3>
                <div class="navSub">
                    <ul class="navSubList list-unstyled">
                        <li class="navSubLi">
                            <h4><a style="text-decoration: none" th:text="'hello，'+${codeUser.nickName}">hello，xxx</a>
                            </h4>
                        </li>
                        <li class="navSubLi">
                            <h4><a th:href="@{/mc/logged/userInformation(userNo=${codeUser.userNo})}">● 个人中心</a></h4>
                        </li>
                        <li class="navSubLi">
                            <h4><a th:href="@{/mc/logged/moneyPay(userNo=${codeUser.userNo})}">● 我的开发宝</a></h4>
                        </li>
                        <li class="navSubLi">
                            <h4><a th:href="@{/mc/item/myCollection(userNo=${codeUser.userNo})}">● 我的收藏</a></h4>
                        </li>
                        <li class="navSubLi">
                            <h4><a th:href="@{/mc/logged/advise(userNo=${codeUser.userNo})}">● 我要建议</a></h4>
                        </li>
                        <li class="navSubLi">
                            <h4><a th:href="@{/mc/}">● 退出登录</a></h4>
                        </li>
                    </ul>
                </div>
            </li>
        </ul>
    </div>
</header>
<!--头结尾-->
<!--动态线条-->
<div class="bannerN animated" style="height: 200px;">
    <div class="imgFull"><img class="img-responsive" th:src="@{/mb/images/ab_bg_01.png}"></div>
    <div class="clouds_one"></div>
    <div class="clouds_two"></div>
    <div class="clouds_three"></div>
</div>
<!--动态线条结尾-->
<div class="hr tp-div-nexthr" style="margin-top: 50px;"></div>
<!--头部代码结束-->
<hr class="layui-bg-green" style="height: 3px;margin-top: 20px">


<div class="container" style="width: 90%">
    <div class="clearfix mtb20 Program">
        <ul class="Program_list">
            <li class="wow fadeInUp mb20" style="height: 800px">
                <em class="icon_Program">
                    <img th:src="@{/mb/images/bg_deng_03.png}">
                </em>
                <h2 th:text="${codeItems.get(0).getItemName()}" style="margin-left: 45%">项目名称</h2>

                <a th:href="@{/mc/stage/stageStartList(userNo=${codeUsers.get(0).getUserNo()},itemNo=${codeItems.get(0).getItemNo()})}">
                    <button style="float: right;color: white;background-image: linear-gradient(#8eb349, #5f7c22);width: 100px;height: 25px">
                        返回
                    </button>
                </a>


                <span th:if="${stageNow}==${num}">
                              <span th:if="${stageCurrent}<=${stageNow}">
<a onclick="recharge()" id="firstbuy">
<button style="float: right;color: white;background-image: linear-gradient(#DE2B1F, #DE2B1F);width: 100px;height: 25px">
                                          项目结款
                                       </button>
                                      </a>
                                  <!--</a>-->
                                  </span>
                              </span>


                <div class="panel-body" style="height: 80%;">
                    <div style="height:40px;font-size: 20px;line-height: 40px;">
                        <span>项目名称 : </span> <span th:text="${codeItems.get(0).getItemName()}">项目名称</span>
                    </div>
                    <hr/>
                    <div>
                        <table style="height: 120px;font-size: 18px;">
                            <tr>
                                <th style="text-align: center;width: 300px">阶段：</th>
                                <th style="text-align: center;width: 300px">阶段名：</th>
                                <th style="text-align: center;width: 300px">阶段交付日期：</th>
                                <th style="text-align: center;width: 300px">阶段内容：</th>
                                <th style="text-align: center;width: 300px">查看阶段文件:</th>
                            </tr>
                            <!--使用循环进行迭代-->
                            <tr th:each="stage:${stages}">
                                <td style="text-align: center;width: 300px" th:text="${stage.stageNum}"></td>
                                <td style="text-align: center;width: 300px" th:text="${stage.stageName}"></td>
                                <td style="text-align: center;width: 300px" th:text="${stage.stageDate}">123456</td>
                                <td style="text-align: center;width: 300px" th:text="${stage.stageExplain}">
                                    12345678912
                                </td>
                                <td style="text-align: center;width: 500px">
                                    <a th:href="@{/mc/item/download(downFile=${fileName},itemNo=${codeItems.get(0).getItemNo()})}">
                        <span th:if="${stage.stageNum}<=${stageNow}">
                          <span th:text="${stage.stageFile}">阶段文件暂无</span>
                        </span>

                                    </a>
                                </td>

                                <td style="text-align: center;;width: 150px">
                        <span th:if="(${stageCurrent}+1)==${stageNow} ">
                       <span th:if="${stage.stageNum}==(${stageCurrent}+1) ">
                           <a th:href="@{/mc/stage/stageFileAgree
                           (partakeNo=${partakeNo},stageNum=${stageCurrent},itemNo=${codeItems.get(0).getItemNo()},checkValue=${stageCurrent}+1,userNo=${codeUsers.get(0).getUserNo()},check=1)
                           }">
                           <button type="button" class="refusebutton">
                            通过验收
                       </button>
                               </a>
                            </span>
                            </span>
                                </td>
                                <td style="text-align: center;;width: 150px">
                        <span th:if="${stageNow}==${stage.stageNum}">
                           <span th:if="${stageCurrent}<${stageNow}">
                                 <a th:href="@{/mc/stage/stageFileAgree
                           (partakeNo=${partakeNo},stageNum=${stageCurrent},itemNo=${codeItems.get(0).getItemNo()},checkValue=${stageNow}-1,userNo=${codeUsers.get(0).getUserNo()},check=0)
                           }">
                                    <button type="button" class="refusebutton">
                            拒绝验收
                               </button>
                                 </a>
                           </span>
                        </span>
                                </td>

                                <td style="text-align: center;;width: 150px">
                                    <span th:if="${stageCurrent}==${stage.stageNum}">
                                    <span th:if="${stageCurrent>0}">
                                 <a th:href="@{/mc/stage/stageFileReturn
                           (partakeNo=${partakeNo},stageCurrent=(${stageCurrent}-1),itemNo=${codeItems.get(0).getItemNo()},stageNow=(${stageNow}-1),userNo=${codeUsers.get(0).getUserNo()})
                           }">
                                    <button type="button" class="refusebutton">
                            回退
                               </button>
                                 </a>
                             </span>
                        </span>
                                </td>

                            </tr>
                        </table>
                    </div>
                </div>
            </li>
        </ul>
    </div>
</div>


<hr class="layui-bg-green" style="height: 3px;margin-top: 20px">


<!--联系我们-->
<div class="contact-container">
    <div class="contact-connect-container">
        <div class="button-container">
            <img th:src="@{/images/contacts.png}"/><span style="margin-left: 5px;">联系我们</span>
        </div>
        <div class="pop" style="display: none;">
            <div class="word" style="text-align: center;"><span style="font-size: 12px;">在线咨询请扫描下面二维码👇</span></div>
            <div style="height: 120px;width: 120px;margin:20px 22px;">
                <img th:src="@{/images/QR.jpg}" style="width: 120px;height: 120px;margin-top: -15px;"/>
            </div>
        </div>
    </div>
</div>

<footer class="footerBg" style="margin-top: 20px">
    <div class="container"><span class="footer_logo"><img th:src="@{/mb/images/mclogo.png}"></span>
        <span style="padding-right: 10px" class="CopyRight_name">码虫互联网服务外包平台 </span></div>
</footer>
</body>
<script th:src="@{/mb/js/jquery-3.3.1.min.js}" type="text/javascript"></script>
<script th:src="@{/mb/js/jquery.js}" type="text/javascript"></script>
<script type="text/javascript" th:src="@{/js/Contacts.js}"></script>
<script th:src="@{/js/layer/layer.js}"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script type="text/javascript" th:src="@{/js/bioV4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/jquery.lazyload.mini.js}"></script>
<script type="text/javascript" th:src="@{/js/function.js}"></script>
<script type="text/javascript" th:src="@{/js/biobox.js}"></script>

<script type="text/javascript">
    function recharge() {
        // console.log(user)
        layer.prompt({
            title: '请输入支付密码，并确认',
            formType: 3
        }, function (value, index) {
            var fd = new FormData();
            var userNo = [[${codeUsers.get(0).getUserNo()}]];
            var itemNo = [[${codeItems.get(0).getItemNo()}]];
            var partakeNo = [[${partakeNo}]];
            var pay = 1;
            var partakeNo = [[${partakeNo}]];
            var stageNum = [[${stageCurrent}]];
            var checkValue = [[${stageCurrent}]];
            checkValue = parseInt(checkValue) + 1;
            fd.append("password", value);
            fd.append("userNo", userNo);
            fd.append("itemNo", itemNo);
            fd.append("partakeNo", partakeNo);
            fd.append("pay", pay);
            fd.append("stageNum", stageNum);
            fd.append("checkValue", checkValue);
            axios.post('/code/mc/stage/stageFilePay', fd).then(function (res) {
                if (res.data == 'ok') {
                    alert("验收成功！！！");
                    window.location.href = '/code/mc/stage/stageStart?itemNo=' + itemNo + '&userNo=' + userNo + '&partakeNo=' + partakeNo;
                }
                else if (res.data == 'less') {
                    alert("余额不足，验收失败，请稍后再试");
                }
                else if (res.data == 'nopsd') {
                    alert("尚未设置密码，请前往设置");
                    window.location.href = '/code/mc/logged/password?userNo=' + userNo;
                }
                else if (res.data == 'stageStart') {
                    alert("123");
                    window.location.href = 'stageStart';
                }
                else {
                    alert(res.data);
                }
            });
            layer.close(index);
        })
    }
</script>

</html>
